<template>
  <basic-container>
    <avue-crud
      :option="option"
      :table-loading="loading"
      :search.sync="search"
      :data="data"
      :page.sync="page"
      :before-open="beforeOpen"
      v-model="form"
      ref="crud"
      :permission="permissionList"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
    >
      <template slot="menuLeft">
        <el-button type="primary" size="small" @click="outRepair()" :disabled="selectionList.length != 1">维修</el-button>
      </template>
      <!--      <template slot="menuRight">-->
      <!--        <user-table-config :option="option" @confirm="(val) => handleSetUserConfig(val, pageCode)"></user-table-config>-->
      <!--      </template>-->
      <template slot="menu" slot-scope="{ row }">
        <el-button type="text" size="small" @click="viewRepair(row)">维修详情</el-button>
      </template>
    </avue-crud>
    <el-dialog
      class="dialog"
      append-to-body
      :close-on-click-modal="false"
      title="维修执行"
      @close="closeDialog"
      :visible.sync="repairDialog"
      v-if="repairDialog"
      width="50%"
      top="20vh"
    >
      <div class="box-card">
        <ul>
          <li class="box-item">
            返厂数量：<span style="font-size: inherit; background: #ffff00">{{ badCodeModel.rmaQuantity || 0 }}</span>
          </li>
          <li class="box-item">
            已完成：<span style="font-size: inherit; background: #caf982">{{ badCodeModel.completedQuantity || 0 }}</span>
          </li>
        </ul>
      </div>
      <div class="sail-header-dialog-content">
        <avue-form ref="badConfirmProperties" v-model="badCodeModel" :option="badCodeOption"> </avue-form>
      </div>
      <div class="mark-btn">
        <el-button type="primary" size="small" @click="handleRepair">提交</el-button>
        <el-button type="primary" size="small" @click="handScrap">报废</el-button>
        <el-button type="primary" size="small" @click="handleEmpty">清空</el-button>
        <el-button type="primary" size="small" @click="handleBack">返回</el-button>
      </div>
    </el-dialog>
    <el-dialog class="dialog" append-to-body :close-on-click-modal="false" title="维修详情" :visible.sync="viewDialog" v-if="viewDialog" width="50%" top="20vh">
      <div class="box-card-view" v-if="viewData.length > 0">
        <ul style="display: flex; flex-direction: row">
          <li class="box-item-view">
            返厂数量：<span style="font-size: inherit; background: #81d3f8">{{ badCodeModel.rmaQuantity || 0 }}</span>
          </li>
          <li class="box-item-view">
            已完成：<span style="font-size: inherit; background: #ffff00">{{ badCodeModel.completedQuantity || 0 }}</span>
          </li>
          <li class="box-item-view">
            报废数：<span style="font-size: inherit; background: #caf982">{{ badCodeModel.scrapQuantity || 0 }}</span>
          </li>
        </ul>
      </div>
      <div class="sail-header-dialog-content">
        <div v-for="(item, index) in viewOptionList" :key="index">
          <avue-form ref="viewProperties" v-model="viewData[index]" :option="item"> </avue-form>
        </div>
      </div>
    </el-dialog>
    <common-modal-template ref="commonModalTemplate" :option="tableOption" @getSelectedRows="getSelectedRows" :key="timer" @newKey="newKey"></common-modal-template>
  </basic-container>
</template>

<script>
import { getList, scrap, getDetail, getProductSequenceNumber, getDetailList, repairAndScrap } from '@/api/repair/rma-repair';
import { mapGetters } from 'vuex';
import CommonModalTemplate from '@/components/common-modal-template/common-modal-template.vue';

import userTableConfig from '@/components/user-table-config';

export default {
  name: 'pendingRepair',
  components: {
    CommonModalTemplate,
    userTableConfig
  },
  data() {
    return {
      pageCode: 'rma-repair',
      modalName: '', //打开公用模态框名称
      tableOption: {}, //公用模态框配置信息
      timer: new Date().getTime(), //不同内容使用同一个模态框结构，key值不同需要重新请求渲染数据，否则会请求到上一个使用的数据内容
      repairDialog: false,
      viewDialog: false,
      query: {},
      search: {},
      viewModel: {},
      badCodeModel: {},
      statisticsObj: {},
      loading: false,
      viewData: [],
      viewOptionList: [],
      selectionList: [],
      page: {
        pageSize: 20,
        currentPage: 1,
        total: 0
      },
      data: [],
      option: {
        header: true,
        height: 'calc(100vh - 500px)',
        calcHeight: 30,
        tip: false,
        searchShow: true,
        searchMenuPosition: 'right',
        border: true,
        index: false,
        indexLabel: '序号',
        selection: true,
        dialogClickModal: false,
        searchLabelWidth: 120,
        labelWidth: 120,
        searchSpan: 6,
        addBtn: false,
        editBtn: false,
        delBtn: false,
        searchBtn: true,
        emptyBtn: true,
        viewBtn: false,
        page: true,
        menuWidth: 100,
        columnBtn: false,
        column: [
          {
            label: 'RMA号',
            prop: 'rmaNo',
            search: true,
            searchSpan: 6,
            searchOrder: 1,
            searchLabelWidth: 100,
            minWidth: 100,
            searchRules: [
              {
                required: false,
                message: '请输入RMA号',
                trigger: 'blur'
              }
            ]
          },
          {
            label: '销售出库单',
            prop: 'deliveryOrderNo',
            search: true,
            searchOrder: 2
          },
          {
            label: '客户名称',
            prop: 'partnerName',
            search: true,
            searchOrder: 2
          },
          {
            label: '产品名称',
            prop: 'partName',
            search: true,
            searchOrder: 3
          },
          {
            label: '产品编码',
            prop: 'partNo'
          },
          {
            label: '订单数量',
            prop: 'orderQuantity'
          },
          {
            label: '返厂数量',
            prop: 'rmaQuantity'
          },
          {
            label: '已完成',
            prop: 'completedQuantity'
          },
          {
            label: '出维修数',
            prop: 'repairedQuantity'
          },
          {
            label: '客户诉求',
            prop: 'clientConcern'
          },
          // {
          //   label: '是否有条码',
          //   prop: 'sequenceNumber'
          // },
          {
            label: '故障说明',
            prop: 'faultDescription'
          }
        ]
      },
      badCodeOption: {
        submitBtn: false,
        emptyBtn: false,
        group: [
          {
            label: 'RMA基础信息',
            arrow: false,
            prop: 'baseInfo',
            icon: 'el-icon-vertical-bar',
            labelWidth: 100,
            column: [
              {
                label: 'RMA号',
                prop: 'rmaNo',
                span: 8,
                disabled: true
              },
              {
                label: '销售出库单号',
                prop: 'deliveryOrderNo',
                span: 8,
                disabled: true
              },
              {
                label: '所属客户',
                prop: 'partnerName',
                span: 8,
                row: true,
                disabled: true
              },
              {
                label: '客户述求',
                prop: 'clientConcern',
                span: 8,
                disabled: true
              },
              {
                label: '退货原因',
                prop: 'reason',
                span: 8,
                disabled: true
              },
              {
                label: '业务员',
                prop: 'salesman',
                span: 8,
                disabled: true
              }
            ]
          },
          {
            label: '产品信息',
            arrow: false,
            prop: 'productInfo',
            icon: 'el-icon-vertical-bar',
            labelWidth: 100,
            column: [
              {
                label: '产品序列号',
                prop: 'productSn',
                span: 8,
                enter: () => {
                  this.enterProductSequenceNumber();
                }
              },
              {
                label: '产品名称',
                prop: 'partName',
                span: 8,
                disabled: true
              },
              {
                label: '产品名称',
                prop: 'partNo',
                span: 8,
                disabled: true
              },
              {
                label: '产品名称',
                prop: 'partModel',
                span: 8,
                disabled: true
              }
            ]
          },
          {
            label: '不良信息',
            arrow: false,
            prop: 'failureInfo',
            icon: 'el-icon-vertical-bar',
            labelWidth: 130,
            column: [
              {
                label: '不良现象',
                prop: 'ngPhenomenonNames',
                // type: 'select',
                // dicUrl: '/api/mes-product/mro/dict/list?dictType=FAILURE',
                // props: {
                //   label: 'name',
                //   value: 'id'
                // },
                disabled: true
              },
              {
                label: '故障说明',
                prop: 'faultDescription',
                disabled: true
              },
              {
                label: '历史不良原因大类',
                prop: 'causeName',
                disabled: true,
                span: 8
              },
              {
                label: '历史不良原因小类',
                prop: 'causeSubName',
                disabled: true,
                span: 8
              },
              {
                label: '历史不良类型',
                prop: 'causeType',
                disabled: true,
                row: true,
                span: 8
              },
              {
                label: '不良原因大类',
                prop: 'mainCauseName',
                type: 'select',
                span: 8,
                dicUrl: '/api/mes-product/mro/dict/list?dictType=CAUSE',
                props: {
                  label: 'name',
                  value: 'id'
                },
                dicFormatter: (data) => {
                  return data.data;
                },
                cascader: ['subCauseName'],
                rules: [
                  {
                    required: true,
                    message: '请输入不良原因大类',
                    trigger: 'change'
                  }
                ]
              },
              {
                label: '不良原因小类',
                prop: 'subCauseName',
                type: 'select',
                dicFlag: false,
                span: 8,
                dicUrl: '/api/mes-product/mro/dict/detail?id={{key}}',
                props: {
                  label: 'name',
                  value: 'id'
                },
                dicFormatter: (data) => {
                  return data.data.subList;
                },
                rules: [
                  {
                    required: true,
                    message: '请输入不良原因小类',
                    trigger: 'change'
                  }
                ]
              },
              {
                label: '不良类型',
                prop: 'faultTypeName',
                type: 'select',
                span: 8,
                // disabled: true,
                dicUrl: '/api/mes-product/mro/dict/list?dictType=FAILURETYPE',
                props: {
                  label: 'name',
                  value: 'id'
                }
              }
            ]
          },
          {
            label: '维修信息',
            arrow: false,
            prop: 'repairInfo',
            icon: 'el-icon-vertical-bar',
            labelWidth: 100,
            column: [
              {
                label: '维修代码',
                prop: 'repairCode',
                type: 'search',
                span: 8,
                appendClick: () => {
                  this.openRepairCodeModel();
                },
                rules: [
                  {
                    required: true,
                    message: '选择维修代码',
                    trigger: 'change'
                  }
                ]
              },
              {
                label: '维修位号',
                prop: 'repairPositionNo',
                span: 8
              },
              {
                label: '维修用料',
                prop: 'repairMaterial',
                span: 8
              },
              {
                label: '维修说明',
                prop: 'repairDescription',
                type: 'textarea',
                row: true,
                minRows: 3,
                maxRows: 3
              },
              {
                label: '报废原因',
                prop: 'scrapCause',
                type: 'textarea',
                row: true,
                minRows: 3,
                maxRows: 3
              },
              {
                label: '维修人',
                prop: 'repairerName',
                row: true,
                span: 8,
                type: 'search',
                appendClick: () => {
                  this.openPrincipalCommonModal();
                },
                rules: [
                  {
                    required: true,
                    message: '请输入维修人',
                    trigger: 'change'
                  }
                ]
              }
            ]
          }
        ]
      },
      viewBaseOption: {
        submitBtn: false,
        emptyBtn: false,
        detail: true,
        group: [
          {
            label: 'RMA基础信息',
            arrow: false,
            prop: 'baseInfo',
            icon: 'el-icon-vertical-bar',
            labelWidth: 100,
            column: [
              {
                label: 'RMA号',
                prop: 'rmaNo',
                span: 8,
                disabled: true
              },
              {
                label: '销售出库单号',
                prop: 'deliveryOrderNo',
                span: 8,
                disabled: true
              },
              {
                label: '所属客户',
                prop: 'partnerName',
                span: 8,
                row: true,
                disabled: true
              },
              {
                label: '客户述求',
                prop: 'clientConcern',
                span: 8,
                disabled: true
              },
              {
                label: '退货原因',
                prop: 'reason',
                span: 8,
                disabled: true
              },
              {
                label: '业务员',
                prop: 'salesman',
                span: 8,
                disabled: true
              },
              {
                label: '不良现象',
                prop: 'failureName',
                type: 'select',
                disabled: true,
                span: 8,
                dicUrl: '/api/mes-product/mro/dict/list?dictType=FAILURE',
                props: {
                  label: 'name',
                  value: 'id'
                }
              },
              {
                label: '故障说明',
                prop: 'remark',
                disabled: true
              }
            ]
          }
        ]
      },
      viewRepairOption: {
        submitBtn: false,
        emptyBtn: false,
        detail: true,
        group: [
          {
            label: '维修信息',
            arrow: false,
            prop: 'repairInfo',
            icon: 'el-icon-vertical-bar',
            labelWidth: 120,
            column: [
              {
                label: '产品序列号',
                prop: 'productSn',
                span: 8,
                display: true,
                disabled: true
              },
              {
                label: '不良原因大类',
                prop: 'causeName',
                span: 8,
                disabled: true
              },
              {
                label: '不良原因小类',
                prop: 'subCauseName',
                span: 8,
                disabled: true
              },
              {
                label: '不良类型',
                prop: 'faultTypeName',
                type: 'select',
                dicUrl: '/api/mes-product/mro/dict/list?dictType=FAILURETYPE',
                props: {
                  label: 'name',
                  value: 'id'
                },
                span: 8,
                disabled: true
              },
              {
                label: '维修代码',
                prop: 'repairCode',
                disabled: true,
                span: 8
              },
              {
                label: '维修位号',
                prop: 'repairPositionNo',
                disabled: true,
                span: 8
              },
              {
                label: '维修用料',
                prop: 'repairMaterial',
                disabled: true,
                span: 8
              },
              {
                label: '维修结果',
                prop: 'status',
                disabled: true,
                span: 8
              },
              {
                label: '维修人',
                prop: 'repairerName',
                disabled: true,
                span: 8
              },

              {
                label: '维修说明',
                prop: 'repairDescription',
                type: 'textarea',
                display: true,
                row: true,
                disabled: true,
                minRows: 3,
                maxRows: 3
              },
              {
                label: '报废原因',
                prop: 'scrapCause',
                type: 'textarea',
                display: true,
                disabled: true,
                row: true,
                minRows: 3,
                maxRows: 3
              }
            ]
          }
        ]
      }
    };
  },
  computed: {
    ...mapGetters(['permission']),
    permissionList() {
      return {
        viewBtn: this.vaildData(this.permission.repairExec_view, false)
      };
    },
    ids() {}
  },
  watch: {},
  mounted() {
    this.$nextTick(() => {
      this.$structuralSplit();
    });
    this.viewData = this._cloneDeep([this.viewBaseOption]);
  },
  computed: {
    ...mapGetters(['permission']),
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids;
    }
  },
  methods: {
    viewRepair(row) {
      getDetailList({
        rmaProductId: row.rmaProductId
      }).then((res) => {
        let data = res.data.data || [];
        let baseData = [row];
        let arr = [];
        let viewData = this._cloneDeep([...baseData, ...data]);
        this.badCodeModel = row;
        console.log(viewData, 'viewData', data, baseData);
        viewData.forEach((item, index) => {
          if (index === 0) {
            arr.push(this.viewBaseOption);
          } else {
            let group = this._cloneDeep(this.viewRepairOption.group);
            let repairInfo = this.findNode(group, 'repairInfo');
            let productSn = this.findObject(repairInfo.column, 'productSn');
            let repairDescription = this.findObject(repairInfo.column, 'repairDescription');
            let scrapCause = this.findObject(repairInfo.column, 'scrapCause');
            repairInfo.label = `维修信息${index}`;
            if (item.productSn) {
              productSn.display = true;
              repairDescription.display = false;
              scrapCause.display = true;
            } else {
              productSn.display = false;
              repairDescription.display = true;
              scrapCause.display = false;
            }
            let option = this._cloneDeep(this.viewRepairOption);
            option.group = group;
            arr.push(option);
          }
        });
        console.log(arr, viewData, 9999);
        this.viewOptionList = this._cloneDeep(arr);
        this.viewData = viewData;
      });
      this.viewDialog = true;
    },
    enterProductSequenceNumber() {
      getProductSequenceNumber({
        productSn: this.badCodeModel.productSn
      }).then((res) => {
        let data = res.data.data;
        this.badCodeModel.causeName = data.causeName || '';
        this.badCodeModel.causeSubName = data.causeSubName || '';
        this.badCodeModel.causeType = data.causeType || '';
        this.$message({
          type: 'success',
          message: '操作成功!'
        });
      });
    },
    handleBack() {
      this.onLoad(this.page);
      this.repairDialog = false;
    },
    closeDialog() {
      this.onLoad(this.page);
      this.repairDialog = false;
    },
    outRepair() {
      this.badCodeModel = this.selectionList[0];
      this.getRmaDetail(this.selectionList[0]);
      this.repairDialog = true;
    },
    handleEmpty() {
      this.$refs.badConfirmProperties.resetFields();
      this.getRmaDetail(this.selectionList[0]);
    },
    getRmaDetail(row) {
      getDetail({
        id: this.badCodeModel.rmaProductId
      }).then((res) => {
        let data = res.data.data;
        this.badCodeModel = {
          ...data,
          ...row,
          completedQuantity: data.completedQuantity,
          scrapQuantity: data.scrapQuantity
        };
        if (
          Number(this.badCodeModel.rmaQuantity) == Number(this.badCodeModel.completedQuantity) &&
          Number(this.badCodeModel.rmaQuantity) > 0 &&
          Number(this.badCodeModel.completedQuantity) > 0
        ) {
          this.repairDialog = false;
          this.onLoad(this.page);
        }
      });
    },
    handleRepair() {
      this.$refs.badConfirmProperties.validate((valid, done) => {
        if (valid) {
          let params = {
            causeId: this.badCodeModel.mainCauseName, //不良原因大类id
            subCauseId: this.badCodeModel.subCauseName, //不良原因小类id
            productSn: this.badCodeModel.productSn, //产品序列号
            repairCode: this.badCodeModel.repairCode, //维修代码
            repairDescription: this.badCodeModel.repairDescription, //维修说明
            repairId: this.badCodeModel.repairId, //维修代码id
            repairMaterial: this.badCodeModel.repairMaterial, //维修用料
            repairPositionNo: this.badCodeModel.repairPositionNo, //维修位号
            repairer: this.badCodeModel.repairer, //维修人id
            repairerName: this.badCodeModel.repairerName, //维修人名字
            rmaProductId: this.badCodeModel.rmaProductId, //rmaProductId
            scrapCause: this.badCodeModel.scrapCause, //报废原因
            status: 3, //3：维修  5：报废
            faultTypeId: this.badCodeModel.faultTypeName
          };
          repairAndScrap(params).then((res) => {
            this.$message({
              type: 'success',
              message: '操作成功!'
            });
            this.getRmaDetail(this.selectionList[0]);
          });
          done();
        }
      });
    },
    handScrap() {
      this.$refs.badConfirmProperties.validate((valid, done) => {
        if (valid) {
          let params = {
            causeId: this.badCodeModel.mainCauseName, //不良原因大类id
            subCauseId: this.badCodeModel.subCauseName, //不良原因小类id
            productSn: this.badCodeModel.productSn, //产品序列号
            repairCode: this.badCodeModel.repairCode, //维修代码
            repairDescription: this.badCodeModel.repairDescription, //维修说明
            repairId: this.badCodeModel.repairId, //维修代码id
            repairMaterial: this.badCodeModel.repairMaterial, //维修用料
            repairPositionNo: this.badCodeModel.repairPositionNo, //维修位号
            repairer: this.badCodeModel.repairer, //维修人id
            repairerName: this.badCodeModel.repairerName, //维修人名字
            rmaProductId: this.badCodeModel.rmaProductId, //rmaProductId
            scrapCause: this.badCodeModel.scrapCause, //报废原因
            status: 5, //3：维修  5：报废
            faultTypeId: this.badCodeModel.faultTypeName
          };
          repairAndScrap(params).then((res) => {
            this.$message({
              type: 'success',
              message: '操作成功!'
            });
            this.getRmaDetail(this.selectionList[0]);
            this.onLoad();
          });
          done();
        }
      });
    },
    beforeOpen(done, type) {
      if (['edit', 'view'].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
      done();
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      params.productStatus = '2';
      this.loading = true;
      getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then((res) => {
        const data = res.data.data;
        this.data = data.records || [];
        this.page.total = data.total;
        this.loading = false;
        this.selectionClear();
      });
    },
    handleReloadRowSave(form, done) {
      this.reload.data.push(form);
      done();
    },
    handleReloadRowUpdate(form, index, done, loading) {
      this.reload.data.splice(index, 1, form);
      done();
    },
    handleReloadRowDel(row, index) {
      this.$confirm('确定将选择数据删除?', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then(() => {
          this.reload.data.splice(index, 1);
        })
        .then(() => {
          this.$message({
            type: 'success',
            message: '操作成功!'
          });
        });
    },
    findNode(list = [], prop) {
      let node;
      list.forEach((ele) => {
        if (ele.prop === prop) node = ele;
      });
      return node;
    },
    // 获取选择的物料模态框行数据
    getSelectedRows(rowData) {
      switch (this.modalName) {
        case 'repairCode':
          this.badCodeModel.repairCode = this._get(rowData, 'code', '');
          this.badCodeModel.repairId = this._get(rowData, 'id', '');
          break;
        case 'principalModal':
          this.badCodeModel.repairerName = this._get(rowData, 'name', '');
          this.badCodeModel.repairer = this._get(rowData, 'id', '');
          break;
        default:
          break;
      }
    },
    openRepairCodeModel() {
      this.$refs.commonModalTemplate.showModal();
      this.modalName = 'repairCode';
      this.tableOption = {
        modalTitle: '选择维修代码信息（双击进行选择）',
        url: '/api/mes-product/mro/dict/list?dictType=ACTION',
        isPage: true,
        index: false,
        rowSelectionType: 'single',
        columnDefs: [
          {
            label: '名称',
            prop: 'name',
            search: true
          },
          {
            label: '编码',
            prop: 'code',
            search: true
          }
        ]
      };
    },
    openPrincipalCommonModal() {
      this.modalName = 'principalModal';
      this.$refs.commonModalTemplate.showModal();
      this.tableOption = {
        modalTitle: '选择用户管理信息（双击进行选择）',
        url: '/api/blade-system/user/page',
        isPage: true,
        rowSelectionType: 'single',
        columnDefs: [
          {
            label: '用户姓名',
            prop: 'realName',
            search: true,
            searchLabelWidth: 150,
            searchSpan: 8
          },
          {
            label: '所属部门',
            prop: 'deptName',
            searchLabelWidth: 150,
            searchSpan: 8
          },
          {
            label: '职务',
            prop: 'postName'
          },
          {
            label: '用户平台',
            prop: 'userTypeName'
          }
        ]
      };
    },
    // 重新加载公用表格弹窗组件
    newKey() {
      this.timer = new Date().getTime();
    }
  }
};
</script>

<style lang="scss" scoped>
.mark-btn {
  display: flex;
  justify-content: flex-end;
}

.box-card {
  height: 80px;
  width: 174px;
  position: absolute;
  right: 6px;
  top: 54px;
  z-index: 100;
  li {
    font-size: 14px;
    height: 20px;
  }
}

.box-card-view {
  position: absolute;
  right: 6px;
  top: 92px;
  z-index: 100;
  li {
    font-size: 14px;
    height: 20px;
  }
}

li {
  list-style: none;
}

::v-deep .el-card__body {
  padding: 7px 0px 0px 0px;
}

.box-item {
  font-size: 15px !important;
  font-weight: bold !important;
  height: 20px !important;
}
.box-item-view {
  font-size: 15px !important;
  font-weight: bold !important;
  height: 20px !important;
  width: 140px !important;
}

.btn-repair {
  display: flex;
  margin: 15px;
  justify-content: flex-end;
}
</style>
